﻿using Inovout.Organizations.Models;
using Inovout.Services;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using System.Linq;
using Inovout.People.Services;

namespace Inovout.Organizations.Services
{
    public class OrganizationUnitService : RepositoryService<OrganizationUnit>, IOrganizationUnitService
    {
        public List<OrganizationUnit> FindByKey(string key)
        {
            IRepositoryService<OrganizationUnit> organizationUnitService = ComponentRegistry.Resolve<IRepositoryService<OrganizationUnit>>();
            //List<OrganizationUnit> list = organizationUnitService.Query().FetchMany(mode => mode.Name.Contains(key, StringComparison.OrdinalIgnoreCase)).ToList<OrganizationUnit>();
            return organizationUnitService.Query().ToList<OrganizationUnit>();
            
        }
    }
}
